package oj;


import java.util.Scanner;

public class Day4S {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int m=sc.nextInt();
            int n=sc.nextInt();
            int a=0;//记录商
            int b=0;//记录余数
            char[] arr=new char[32];
            while (m!=0){//商不为0
               a=m/n;
               b=m%n;
               m=a;
            }
        }
    }
}
